import random
def readtxt():  #返回列表
    wordlist = []
    for line in open("keywords.txt", encoding='utf-8'):
        wordlist.append(line.strip())
    # print(wordlist)
    return wordlist


#返回随机一个关键词，从keywords.txt
def getKeywords():
    def readtxt():  # 返回列表
        wordlist = []
        for line in open("keywords.txt", encoding='utf-8'):
            wordlist.append(line.strip())
        # print(wordlist)
        return wordlist
    list = readtxt()
    a = random.choice(list)
    # print(type(a))
    return a

#返回后缀
def getBackwords():
    wordlist = []
    for line in open("backwords.txt", encoding='utf-8'):
        wordlist.append(line.strip())
    # print(wordlist)
    a = random.choice(wordlist)
    # print(a)
    return a


#读取链接库的链接,随机选出一条
def readlinks():  #返回列表
    wordlist = []
    for line in open("links1.txt", encoding='utf-8'):
        wordlist.append(line.strip())
    # print(wordlist)
    link = random.choice(wordlist)
    return link

#返回随机link，从links.txt
def getlinkwords():
    list = readlinks()
    a = random.choice(list)
    # print(type(a))
    return a
print(getlinkwords())
# print(getweixin())
